// 找出单向链表中倒数第 k 个节点。返回该节点的值
int kthToLast(ListNode* head, int k) 
{
    ListNode *pre = head, *cur = head;
    while(k--) cur = cur->next;
    
    while(cur)
    {
        cur = cur->next;
        pre = pre->next;
    }
    return pre->val;
}